package IC.Error;

public class ErrorStackVisitor extends Visitor {
	
	public Object Visit (ErrorString error)
	{
		System.out.println(error.GetType() + " : " + error.GetString());
		return null;
	}
	
	public Object Visit (ErrorStringIntervaled error)
	{
		if (error.GetType() == Error.ErrorType.Semantic)
			System.out.format("semantic error at line %d:%s\n", 
					error.GetInterval().GetMin(), error.GetString());
		else
			System.out.format("%s at line %d : %s\n", 
					error.GetType(), error.GetInterval().GetMin(), error.GetString());	
		return null;
	}
}
